/**
 * @author Hoang
 */
function CustomerModel() {
	this.parent();
}

CustomerModel.inherits(BaseModel, {

});

var Customer = function(customers) {
	this.customers = customers;
}
function createCustomerModel(cus) {
	var customer = cus.getElementsByTagName("User");
	var arrCus = [];
	var customerId;
	var customerUsername;
	var customerLName;
	var customerFName;
	var customerPhone;
	var customerAddress;
	var customerIsBan;
	var customerEmail;

	for (var i = 0; i < customer.length; i++) {
		customerId = customer[i].getAttribute("userId");
		customerUsername = customer[i].getElementsByTagName("userName")[0].childNodes[0].nodeValue;
		customerLName = customer[i].getElementsByTagName("lastName")[0].childNodes[0].nodeValue;
		customerFName = customer[i].getElementsByTagName("firstName")[0].childNodes[0].nodeValue;
		customerPhone = customer[i].getElementsByTagName("phone")[0].childNodes[0].nodeValue;
		customerAddress = customer[i].getElementsByTagName("address")[0].childNodes[0].nodeValue;
		customerIsBan = customer[i].getElementsByTagName("isBanned")[0].childNodes[0].nodeValue;
		customerEmail = customer[i].getElementsByTagName("email")[0].childNodes[0].nodeValue;
		
		arrCus[i] = {
			"customerId" : customerId,
			"customerUsername" : customerUsername,
			"customerLName" : customerLName,
			"customerFName" : customerFName,
			"customerPhone" : customerPhone,
			"customerAddress" : customerAddress,
			"customerIsBan" : customerIsBan,
			"customerEmail" : customerEmail,
		}
	}

	return new Customer(arrCus);
}